package SPA;

/**
 * DFA State Transition as a Submachine call
 */
public class SubmachineCallTransition extends Transition
{
	private DFA automaton;
	
	/**
	 * A Submachine call transition
	 * @param automaton	the automaton called
	 * @param nextState	next state of the transition
	 */
	public SubmachineCallTransition(DFA automaton, DFAState nextState, String semanticActionName)
	{
		super (nextState, semanticActionName);
		this.setAutomaton(automaton);
	}
	
	
	/**
	 * @param automaton the automaton to set
	 */
	public void setAutomaton(DFA automaton) {
		this.automaton = automaton;
	}

	/**
	 * @return the automaton
	 */
	public DFA getAutomaton() {
		return automaton;
	}
	
	public String toString()
	{
		return "MachineCallTransition (" + this.automaton + ", " + this.getNextState() + ") & SemanticAction: " + this.getSemanticActionName();
	}
}
